package a.f.g;

import a.c.d;
import a.c.e;
import a.c.k;
import a.c.*;
import a.f.o;
import a.f.rc;
import a.f.vc;
import a.f.wc;
import a.i.p;

public class m
  implements vc
{
  Object e = rc.c;
  Object f = rc.d;
  double g = 0.0D;
  rc h;
  double i = 100.0D;
  public static boolean j;
  
  public Object b()
  {
    return this.f;
  }
  
  public void a(Object paramObject)
  {
    if (paramObject == null) {
      throw new IllegalArgumentException("null");
    }
    this.f = paramObject;
  }
  
  public Object c()
  {
    return this.e;
  }
  
  public void b(Object paramObject)
  {
    if (paramObject == null) {
      throw new IllegalArgumentException("null");
    }
    this.e = paramObject;
  }
  
  public void a(double paramDouble)
  {
    this.i = paramDouble;
  }
  
  public double d()
  {
    return this.i;
  }
  
  public double e()
  {
    return this.g;
  }
  
  public void b(double paramDouble)
  {
    this.g = paramDouble;
  }
  
  public boolean canLayout(o paramo)
  {
    return true;
  }
  
  public void doLayout(o paramo)
  {
    if (this.h != null)
    {
      x localx = paramo.B();
      n localn = paramo.C();
      a(paramo, localx, localn, d());
      Object localObject = c();
      k localk1 = paramo.c(b());
      k localk2 = paramo.c(localObject);
      p local0 = new p()
      {
        private final x val$splitNodes;
        private final k val$sedp;
        private final k val$origSNDP;
        
        public boolean getBool(Object paramAnonymousObject)
        {
          Object localObject = this.val$splitNodes.get(paramAnonymousObject);
          if (localObject != null)
          {
            if ((j.c) || (this.val$sedp != null)) {
              return this.val$sedp.getBool(localObject);
            }
            return false;
          }
          return this.val$origSNDP.getBool(paramAnonymousObject);
        }
      };
      paramo.a(localObject, local0);
      this.h.doLayout(paramo);
      paramo.j(localObject);
      if (!j.c)
      {
        if (localk2 != null) {
          paramo.a(localObject, localk2);
        }
        a(paramo, localx);
        paramo.a(localx);
      }
      paramo.a(localn);
    }
  }
  
  private void a(o paramo, x paramx, n paramn, double paramDouble)
  {
    boolean bool = j.c;
    int m = j.b;
    d[] arrayOfd = paramo.u();
    int k = 0;
    do
    {
      while (m == 0)
      {
        if (k >= arrayOfd.length) {
          break;
        }
        a(paramo, arrayOfd[k], paramx, paramn, paramDouble);
        k++;
      }
    } while (bool);
  }
  
  private void a(o paramo, d paramd, x paramx, n paramn, double paramDouble)
  {
    boolean bool = j.c;
    int n = j.b;
    double d1 = wc.a(paramo, paramd);
    int k = (int)(d1 / paramDouble);
    if (!bool) {
      if (k <= 1) {
        return;
      }
    }
    int m = k - 1;
    paramDouble = d1 / k;
    z localz = paramo.o(paramd);
    a.d.w localw1 = (a.d.w)localz.b();
    a.d.w localw2 = null;
    Object localObject = paramd.e();
    if (!bool) {}
    d locald1 = paramn.get(paramd) == null ? paramd : (d)paramn.get(paramd);
    double d2 = 0.0D;
    if (!localz.isEmpty())
    {
      localw2 = localw1;
      localw1 = (a.d.w)localz.b();
    }
    label332:
    label334:
    label351:
    do
    {
      double d3 = a.d.w.a(localw2, localw1);
      double d4 = (localw1.a - localw2.a) / d3;
      double d5 = (localw1.b - localw2.b) / d3;
      double d6 = paramDouble - d2;
      if (!bool)
      {
        if (d6 < d3)
        {
          do
          {
            do
            {
              if (d6 >= d3) {
                break;
              }
              double d7 = localw2.a + d6 * d4;
              double d8 = localw2.b + d6 * d5;
              e locale = paramo.i();
              paramo.b(locale, this.g, this.g);
              paramo.a(locale, d7, d8);
              paramx.a(locale, locald1);
              d locald3 = paramo.a((e)localObject, locale);
              paramn.a(locald3, locald1);
              localObject = locale;
              d6 += paramDouble;
              if (bool) {
                break label334;
              }
              if (n != 0) {
                break label332;
              }
            } while (n == 0);
          } while (bool);
          d2 = d3 - (d6 - paramDouble);
          if (bool) {
            break label351;
          }
          if (n == 0) {
            break;
          }
        }
        d2 += d3;
      }
      if (n == 0) {
        break;
      }
      d locald2 = paramo.a((e)localObject, paramd.f());
      paramn.a(locald2, locald1);
      paramo.f(paramd);
    } while (bool);
  }
  
  private void a(o paramo, int paramInt)
  {
    boolean bool = j.c;
    int m = j.b;
    a.c.m localm = paramo.w();
    label77:
    label79:
    do
    {
      do
      {
        if (!localm.e()) {
          return;
        }
        d locald = localm.a();
        int k = 0;
        do
        {
          if (k >= paramInt) {
            break;
          }
          a(paramo, locald);
          k++;
          if (bool) {
            break label79;
          }
          if (m != 0) {
            break label77;
          }
        } while (m == 0);
      } while (bool);
      localm.f();
    } while (m == 0);
  }
  
  private void a(o paramo, d paramd)
  {
    boolean bool = j.c;
    int k = j.b;
    if (!bool) {
      if (paramo.b(paramd).a() == 0) {
        return;
      }
    }
    z localz1 = paramo.o(paramd);
    Object localObject = (a.d.w)localz1.b();
    z localz2 = new z();
    if (!localz1.isEmpty()) {}
    while (bool)
    {
      a.d.w localw1 = (a.d.w)localz1.b();
      a.d.w localw2 = a.d.w.d((a.d.w)localObject, localw1);
      localz2.add(localw2);
      localObject = localw1;
      if ((!bool) && (k != 0)) {
        return;
      }
      if (k == 0) {
        break;
      }
    }
    paramo.b(paramd, localz2);
  }
  
  private void a(o paramo, x paramx)
  {
    boolean bool = j.c;
    int k = j.b;
    a.c.w localw = paramo.v();
    label140:
    label142:
    label281:
    label342:
    label350:
    do
    {
      do
      {
        if (!localw.e()) {
          break;
        }
        Object localObject1 = localw.d();
        d locald1 = (d)paramx.get(localObject1);
        if (k != 0) {
          break label384;
        }
        if (locald1 != null)
        {
          do
          {
            if (bool) {
              break label350;
            }
            if (paramo.j(locald1)) {
              break label342;
            }
            e locale = ((e)localObject1).m().a().e();
            do
            {
              if (paramx.get(locale) == null) {
                break;
              }
              localObject1 = locale;
              if (bool) {
                break label142;
              }
              locale = ((e)localObject1).m().a().e();
              if (k != 0) {
                break label140;
              }
            } while (k == 0);
          } while (bool);
          paramo.g(locald1);
          d locald2 = ((e)localObject1).i();
          z localz = new z();
          Object localObject2 = null;
          a.d.w localw1;
          if (paramx.get(locald2.f()) != null) {
            localw1 = paramo.r(locald2);
          }
          do
          {
            if (k != 0) {
              break label281;
            }
            if (!localw1.equals(localObject2)) {
              localz.add(localw1);
            }
            localz.a(paramo.m(locald2));
            localObject2 = paramo.s(locald2);
            if (!bool)
            {
              if (!((a.d.w)localObject2).equals(localw1)) {
                localz.add(localObject2);
              }
              locald2 = locald2.f().h();
            }
            if (k == 0) {
              break;
            }
            localw1 = paramo.r(locald2);
          } while (bool);
          if (!localw1.equals(localObject2)) {
            localz.add(localw1);
          }
          localz.a(paramo.m(locald2));
          if (!bool)
          {
            localObject2 = paramo.s(locald2);
            if (!((a.d.w)localObject2).equals(localw1)) {
              localz.add(localObject2);
            }
          }
          paramo.a(locald1, localz);
        }
        localw.f();
      } while (k == 0);
    } while (bool);
    label384:
    do
    {
      localw = paramo.v();
      while (k == 0)
      {
        if (!localw.e()) {
          break;
        }
        if (paramx.get(localw.d()) != null) {
          paramo.a(localw.d());
        }
        localw.f();
      }
    } while (bool);
  }
  
  double a(o paramo)
  {
    boolean bool = j.c;
    int k = j.b;
    double d = 0.0D;
    a.c.m localm = paramo.w();
    if (localm.e()) {}
    while (bool)
    {
      if (k != 0) {
        break label72;
      }
      d += c(paramo, localm.a());
      localm.f();
      if (k == 0) {
        break;
      }
    }
    label72:
    return d / paramo.l();
  }
  
  double c(o paramo, d paramd)
  {
    return wc.a(paramo, paramd.e(), paramd.f());
  }
  
  public rc a()
  {
    return this.h;
  }
  
  public void a(rc paramrc)
  {
    this.h = paramrc;
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.g.m

 * JD-Core Version:    0.7.0.1

 */